This invention relates to position/speed detection method and apparatus in which a stable sampling time can be achieved, the sampled and held two-phase waves of an encoder original signal are pulse-width modulated, and the amplitude fluctuation of the encoder original signal is corrected by the pulse width of the two-phase waves. Particularly, this invention relates to a position/speed detection method and apparatus suitable for detecting the rotational position and speed with high precision irrespective of the amplitude fluctuation of the encoder original signal.
This position/speed detection method and apparatus are used with drive motors and various different servo motors for NC (numeral control) apparatus, robots and so on.
This invention is suitable for digital control using a microcomputer.
There is a known speed detection method using an encoder pulse as shown in FIG. 6. FIG. 7 shows a timing chart for the speed detection.
This is, a microcomputer in an arithmetic control unit is formed of a CPU 101, a ROM 102 and a RAM 103, and performs control and arithmetic operations for speed detection.
The speed, V.sub.F is determined by the ratio of the number, P.sub.N of encoder pulses within a constant time to the time, Td, based on the following equation: EQU V.sub.F =K.sub.1 .multidot.P.sub.N /Td (1)
where K.sub.1 is a constant dependent on the number of encoder pulses per revolution.
The encoder is generally mounted on the shaft of a moving body or rotating body, for example, a servo motor. The output signal from the encoder, or encoder pulse is formed of two-phase signals of phases A and B displaced 90.degree. from each other as shown in FIG. 7A.
An encoder pulse shaping circuit 108 shown in FIG. 6 detects the leading and trailing edges of the two-phase pulse signals and generates a T.sub.1 signal (having 1/4 the period of the encoder pulse) as shown in FIG. 7B.
A sampling timer 104 shown in FIG. 6 is connected to a data bus 111 of the microcomputer and produces a T.sub.2 signal with a sampling time Ts for the speed detection as shown in FIG. 7C.
A pulse counter 105 in FIG. 6 is connected to the data bus 111 of the microcomputer and counts the number (data P.sub.N of encoder pulses within the sampling time Ts. The data (FIG. 7E) from the counter 105 is supplied through the data bus 111 to the microcomputer.
A synchronizing circuit 107 in FIG. 6 latches the T.sub.2 signal for sampling in response to the T.sub.1 signal and produces a T.sub.3 signal as shown in FIG. 7D.
A time-width counter 106 as a time width timer in FIG. 6 is connected to the data bus 111 of the microcomputer as the sampling timer 104 and pulse counter 105 are connected and counts the time width of the T.sub.3 signal from the synchronizing circuit 107. The counted data (FIG. 7F) of time interval Td is supplied throught the data bus 111 to the microcomputer.
In FIG. 6, 110 represents an address bus, 112 a reference clock signal line and 113 an interrupt signal line.
Thus, the data of the number P.sub.N (FIG. 7E) of encoder pulses and data (FIG. 7F) of the time interval Td are arithmetically processed in accordance with Equation (1) by the microcomputer, so as to produce the speed Vp.
This previously proposed speed detection method is able to detect the speed with high precision when the motor is rotated at a high speed.
In this method, however, when the motor speed is reduced, it cannot be detected at each sampling time.
FIG. 8 shows a timing chart for low speed.
When the motor is rotated at a low speed, the sampling time Ts (FIG. 8C) may not be synchronized with the encoder pulse (FIG. 8A) (region B), or may be synchronized therewith but in this case the time interval Td (FIG. 8D) becomes very long (region A).
In those cases, since the sampling time Ts is regarded as being equivalently extended, the control system has a poor response.
Moreover, when the motor is still in its rotation, the above method of detecting the speed cannot be detected. This disadvantage should be obviated.